<!-- 结算汇总 -->
<template>
  <div class="app-container">
    <el-card>
      <el-row :gutter="24" class="fz-14 tc">
        <el-col :span="5">
          <div class="color6">咨询订单</div>
          <div class="pt-10">{{form.orderNo || ""}}</div>
        </el-col>
        <el-col :span="2">
          <div class="color6">结算金额</div>
          <div class="pt-10">￥{{form.billcost || 0}}</div>
        </el-col>
        <el-col :span="2">
          <div class="color6">咨询类型</div>
          <div class="pt-10">
            <dict-tag :options="dict.type.calltype" :value="form.callType" />
          </div>
        </el-col>
        <el-col :span="2">
          <div class="color6">发起终端</div>
          <div class="pt-10">{{ form.platform }}</div>
        </el-col>
        <el-col :span="3">
          <div class="color6">会议编号</div>
          <div class="pt-10">{{ form.meetingRoomNumber }}</div>
        </el-col>
        <el-col :span="2">
          <div class="color6">会议发起人</div>
          <div class="pt-10">{{ form.sponsor }}</div>
        </el-col>
        <el-col :span="4">
          <div class="color6">开始时间</div>
          <div class="pt-10">{{ parseTime(form.callTimestart) }}</div>
        </el-col>
        <el-col :span="4">
          <div class="color6">结束时间</div>
          <div class="pt-10">{{ parseTime(form.callTimeend) }}</div>
        </el-col>
      </el-row>
    </el-card>

    <el-table v-loading="loading" :data="detailsList" class="mt-20">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="ID" width="80" prop="order_exp_id" align="center" />
      <el-table-column label="订单编号" width="200" prop="play_no" align="center" />
      <el-table-column label="结算参与方" prop="start" align="center" min-width="250" />
      <el-table-column
        label="参与方角色"
        prop="startname"
        width="100"
        align="center"
      >
        <template slot-scope="scope">
          <dict-tag
            :options="dict.type.startname"
            :value="scope.row.startname"
          />
        </template>
      </el-table-column>
      <el-table-column label="结算金额" prop="number" align="center" />
      <el-table-column label="结算类型" align="center">
        <template slot-scope="scope">
          <dict-tag
            :options="dict.type.billtype"
            :value="scope.row.billtype"
          />
        </template>
      </el-table-column>
      <el-table-column label="结算状态" align="center">
        <template slot-scope="{row}">
          <div>已结算</div>
        </template>
      </el-table-column>
      <el-table-column label="结算时间" prop="create_time" align="center" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.create_time) }}</span>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="total > 0 && total > queryParams.pageSize"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script>
import { groupList,getOrderInfo } from "@/api/order/order";
export default {
  name: "Resultdetails",
  dicts: ['calltype','startname','billtype'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 总条数
      total: 0,
      orderId: "",
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10
      },
      // 表单参数
      form: {},
      // 咨询详情表格数据
      detailsList: [],
    };
  },
  created() {
    this.orderId = this.$route.params && this.$route.params.orderId;
    this.getList();
    this.getOrderInfo();
  },
  methods: {
    /** 查询咨询详情列表 */
    getList() {
      this.loading = true;
      groupList(this.orderId, this.queryParams).then(response => {
        this.detailsList = response.rows
        this.total = response.total;
        this.loading = false;
      });
    },
    getOrderInfo() {
      getOrderInfo(this.orderId).then((res) => {
        this.form = res.data;
      });
    },
  }
};
</script>
